#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include "testutils.h"

/*
 * +1 card with cost <= 5
 */
void feast_test()
{
	int i, j;
	int choice;
	int temphand[MAX_HAND];
	struct gameState state;

	init_test_date(&state, 1);

	srand(time(NULL));

	for(i = 0; i < MAX_ITERATIONS; i++) {
		state.deckCount[0] = 50;
		for (j = 0; j < state.deckCount; j++) {
			state.deck[0][j] = random_card();
		}

		state.handCount[0] = 5;
		for (j = 0; j < 4; j++) {
			state.hand[0][j] = random_card();
		}
		state.hand[0][4] = feast;

		choice = random_kcard();

		if (supplyCount(choice) <= 0 && feast_effect(&state, 0, temphand, choice) != -1) {
			printf("ERROR: iteration %d - no card in supply, but feast effect did not fail.\n", i);
		}

		if (getCost(choice) > 5 && feast_effect(&state, 0, temphand, choice) != -1) {
			printf("ERROR: iteration &d - choice cost > 5, but feast effect did not fail.\n", i);
		}
	}
}

int int main(int argc, char const *argv[])
{
	feast_test();
	return 0;
}